{extend name="base" /}
{block name="body"}
<div class="layui-card">
  <div class="layui-card-body">
    <blockquote class="layui-elem-quote layui-text">
        初始密码：<span class="text-danger">{$data.pwd}</span>，用户登陆后需自行修改！重置功能为重置登陆密码，重置登陆密码后用户需要自行修改支付密码方可使用支付功能。
    </blockquote>
    <div class="layui-form-item">
      <form class="layui-form layui-form-pane" action="{:request()->url()}" >
        <div class="layui-input-inline">
            <input type="text" name="title" lay-verify="title" autocomplete="off" placeholder="{if $Request.get.title}{$Request.get.title}{else}请输入关键字{/if}" class="layui-input">
        </div>
        <div class="layui-input-inline">
            <button type="submit" class="layui-btn" lay-submit="" lay-filter="demo1">{$Think.lang.search}</button>
            <button type="reset" class="layui-btn layui-btn-primary">{$Think.lang.reset}</button>
        </div>
        </form>
      <button class="layui-btn layui-btn-normal open-popup" data-title="{$Think.lang.add}" data-size="auto" data-url="{:url('add')}"><i class="fa fa-plus"></i>{$Think.lang.add}</button>
      <button class="layui-btn ajax-get" data-title="{$Think.lang.export}" data-size="auto" data-url="{:url('export')}"><i class="fa fa-file-excel-o"></i>{$Think.lang.export}</button>
    </div>
        <table class="layui-table layui-form" lay-skin="line">
            <thead>
                <tr>
                    <th>{$Think.lang.id}</th>
                    <th>{$Think.lang.name}</th>
                    <th>{$Think.lang.phone}</th>
                    <th>{$Think.lang.username}</th>
                    <th>{$Think.lang.sex}</th>
                    <th>{$Think.lang.money}</th>
                    <th>{$Think.lang.integral}</th>
                    <th>{$Think.lang.growth}</th>
                    <th>{$Think.lang.rank}</th>
                    <th>{$Think.lang.createtime}</th>
                    <th>{$Think.lang.status}</th>
                    <th>{$Think.lang.transfer}</th>
                    <th>{$Think.lang.handle}</th>
                </tr>
            </thead>
            <tbody>
                {volist name="list" id="v" empty="$empty"}
                <tr>
                    <td>{$i}</td>
                    <td><img src="{$v.headimgurl|default=''}" style="border-radius: 50%;width: 30px;">{if $v.nick_name}{$v.nick_name}{else}{$v.name|default=$Think.lang.notset}{/if}&nbsp;{if $v.is_active}<span class="layui-badge layui-badge-green">{$Think.lang.active}</span>{else}<span class="layui-badge layui-badge-red">{$Think.lang.notactive}</span>{/if}</td>
                    <td>{$v.mobile|substr_replace='****',3,4}</td>
                    <td>{if $v.real_name}<span class="layui-badge layui-badge-green">{$v.real_name|substr_replace='*',3,3}{else}<span class="layui-badge layui-badge-red">{$Think.lang.notrealname}{/if}</span></td>
                    <td>{$v.gender|default="未知"}</td>
                    <td>{$v.money|default="0.00"}</td>
                    <td>{$v.integral|default="0"}</td>
                    <td>{$v.growth|default="0"}</td>
                    <td>
                        <!-- <span class="layui-badge layui-badge-green">{$v.rank_name|default=$data.rank_name}</span> -->
                        {if $v.grade eq 5}<span class="layui-badge layui-badge-blue">总代{elseif $v.grade eq 4}<span class="layui-badge layui-badge-cyan">省代{elseif $v.grade eq 3}<span class="layui-badge layui-badge-yellow">市代{elseif $v.grade eq 2}<span class="layui-badge layui-badge-green">县代{elseif $v.grade eq 1}<span class="layui-badge layui-badge-red">店家{else}<span class="layui-badge layui-badge-gray">会员{/if}</span>
                    </td>
                    <td>{$v.create_time|date="Y-m-d"}</td>
                    <td><input type="checkbox" name="status" value="{$v.id}" lay-skin="switch" lay-filter="*" lay-text="开启|禁用" data-url="{:url('edit')}" {if $v.status eq 1}checked{/if}></td>
                    <td><input type="checkbox" name="is_frozen" value="{$v.id}" lay-skin="switch" lay-filter="*" lay-text="开启|冻结" data-url="{:url('edit')}" {if $v.is_frozen eq 1}checked{/if}></td>
                    <td>
                        <button class="layui-btn layui-btn-primary layui-btn-xs open-popup" data-title="{$v.name|default=$Think.lang.notset} {$Think.lang.log}" data-url="{:url('log', ['id' => $v.id])}"><i class="fa fa-gg"></i>{$Think.lang.log}</button>
                        <button class="layui-btn layui-btn-warm layui-btn-xs open-popup" data-title="{$v.name|default=$Think.lang.notset} {$Think.lang.account}调节" data-url="{:url('account', ['id' => $v.id])}"><i class="fa fa-bitcoin"></i>{$Think.lang.account}</button>
                        <button class="layui-btn layui-btn-xs open-popup" data-title="{$Think.lang.edit}" data-url="{:url('edit', ['id' => $v.id])}"><i class="fa fa-edit"></i>{$Think.lang.edit}</button>
                        <button class="layui-btn layui-btn-normal ajax-del layui-btn-xs" data-title="{$Think.lang.reset} {$v.name|default=$Think.lang.notset}" data-url="{:url('reset', ['id' => $v.id])}"><i class="fa fa-refresh"></i></i>{$Think.lang.reset}</button>
                        <button class="layui-btn layui-btn-danger ajax-del layui-btn-xs" data-title="{$Think.lang.drop} {$v.name|default=$Think.lang.notset}" data-url="{:url('del', ['id' => $v.id])}"><i class="fa fa-trash-o"></i>{$Think.lang.drop}</button>
                    </td>
                </tr>
                {/volist}
            </tbody>
        </table>
        <div class="page">{$list|raw}</div>
    </div>
</div>
{/block}
{block name="js"}
{/block}